<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>${SYSTEM_NAME}</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css?v=${FILE_VERSION}" media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css?v=${FILE_VERSION}" media="all">
</head>
<body>
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-card-body" style="padding: 15px;">
		<form class="layui-form" action="" style="width:100%" method="post" name="basicform">
			<input type="hidden" name="id" id="id" value="${paramBasicType.id }"/>
		  <div class="layui-form-item">
		    <label class="layui-form-label layui-form-required">所属字典</label>
		    <div class="layui-input-inline">
		      <div class="layui-input-inline">
				  <input type="hidden" value="${paramBasicType.basicId}" name="basicId">
				  <input type="text"  lay-verify="required" class="layui-input" value="${paramBasicType.basicName }" readonly>
		     </div>
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label layui-form-required">键</label>
		    <div class="layui-input-inline">
		      <input type="text" name="paramKey" lay-verify="required" placeholder="请输入键" class="layui-input" autocomplete="off" value="${paramBasicType.paramKey }">
		    </div>
		    <div class="layui-form-mid layui-word-aux">键不能为空</div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label layui-form-required">值</label>
		    <div class="layui-input-inline">
		      <input type="text" name="paramValue" lay-verify="required" placeholder="请输入值" class="layui-input" value="${paramBasicType.paramValue }">
		    </div>
		    <div class="layui-form-mid layui-word-aux">值不能为空</div>
		  </div>

		<div class="layui-form-item">
			<label class="layui-form-label layui-form-required">排序</label>
			<div class="layui-input-inline">
				<input type="text" name="sort" lay-verify="number"
					   placeholder="请输入排序" class="layui-input"
					   autocomplete="off" value="${paramBasicType.sort}"
					   maxlength="5">
			</div>
			<div class="layui-form-mid layui-word-aux">排序为数字</div>
		</div>
		  
		  <div class="layui-form-item">
		    <label class="layui-form-label">描述</label>
		    <div class="layui-input-inline">
		      <input type="text" name="desp" class="layui-input" value="${paramBasicType.desp }" placeholder="请输入描述">
		    </div>
		  </div>

			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn layui-btn-primary layui-border-blue" lay-submit="" lay-filter="sub">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-border-blue">重置</button>
					<button type="button" class="layui-btn layui-btn-primary layui-border-red" onclick="closed()">关闭</button>
				</div>
			</div>
		</form>
		</div>
	</div>
  </div>
<script src="${pageContext.request.contextPath}/static/js/common-2.0.0.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/js/common/coreInput-2.0.0.js?v=${FILE_VERSION}"></script>
<script>
	layui.use(['form'], function() {
		var form = layui.form;
		var id =$("#id").val();
		var fristHalfUrl = "/sys/paramBasicType";
		form.on('submit(sub)', function(data){
			var url;
			if(id == ""){
				url = fristHalfUrl + "/add/save";
			}else{
				url = fristHalfUrl + "/edit/save";
			}
			$ajax({
				url: url,
				data :  data.field,
				succCallback: function (json) {
					if(json.code == 0){
						parent.reload();
						closed();
						parent.layer.msg(json.msg);
					}
				}
			});
			return false;
		});
	});

</script>
</body>
</html>